<template>
  <div>
    <ul>
      <li v-for="goods in goodslist" :key="goods.id">
          {{goods.id}}-  {{goods.title}}-  {{goods.price}}
    </li>
    </ul>
  </div>
</template>

<script>

import {computed} from 'vue'
//映射
import { mapState, mapActions } from "vuex"
export default {
    created() {
        this.$store.dispatch("goods/getList");
    },
    computed:mapState({
        goodslist:(state)=>{ return state.goods.list}
    })
};
</script>